package org.example.demo.chat.ext

import org.example.demo.chat.constant.BOT_STATUS_CANCELED
import org.example.demo.chat.constant.BOT_STATUS_COMPLETED
import org.example.demo.chat.constant.BOT_STATUS_FAILED
import org.example.demo.chat.constant.BOT_STATUS_REQUIRES_ACTION
import org.example.demo.chat.response.ChatRetrieveResponse

fun ChatRetrieveResponse.isFinished(): Boolean {
    return data?.status == BOT_STATUS_COMPLETED
            || data?.status == BOT_STATUS_FAILED
            || data?.status == BOT_STATUS_REQUIRES_ACTION
            || data?.status == BOT_STATUS_CANCELED
}